package 周赛._283;

import java.util.ArrayList;
import java.util.List;

public class _6016_Excel表中某个范围内的单元格 {
    public static void main(String[] args) {
        cellsInRange("K1:L2");
    }
    public static List<String> cellsInRange(String s) {
        List<String> ans = new ArrayList<>();
        String[] strs = s.split(":");
        int cols = strs[1].charAt(0) - strs[0].charAt(0);
        int rows = strs[1].charAt(1) - strs[0].charAt(1);
        for (int i = 0; i <= cols; i++) {
            for (int j = 0; j <= rows; j++) {
                String temp = (char)(i + strs[0].charAt(0)) + String.valueOf((char)(j + strs[0].charAt(1)));
                ans.add(temp);
            }
        }
        return ans;
    }
}
